package com.hong.spring.mvc.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/")
public class HomeController {
  private static Logger log = LogManager.getLogger(HomeController.class.getName());

  @RequestMapping(value = "",method = RequestMethod.GET)
  public String home(ModelMap model) {
    log.info("进入了首页！");
    log.error("error进入了首页！");
    model.addAttribute("message","Hello home");
    return "home";
  }

}